let base = "https://hkyfke9y.lc-cn-n1-shared.com"
function http(url,data,method="GET"){
   return new Promise((resolve,reject)=>{
    wx.request({
              url:base+url,
              method,
              header:{
                'X-LC-Id': ' hKyfke9yHid363hnI0IdUCSA-gzGzoHsz', 
                'X-LC-Key': ' PI9zq6sBRTAAlQaNXmLjqgRk', 
                'Content-Type': ' application/json'
              },
              data,
              success:(res=>{
                  resolve(res)
              }),
              fail:(err=>{
                  reject(err)
              })
            })
   }) 
}
function post(url,data){
    return http(url,data,"post")
}
function get(url,data){
    return http(url,data,"get")
}
module.exports={
    http,
    post,
    get
}